﻿#include "Common.h"
#include "Virtual.h"

class C : public FinalClass{
public:
	//error C2248: 'FinalBase<T>::FinalBase' : cannot access private member declared in class 'FinalBase<T>'
    //C(){}
};

void main()
{
	DisableCopyClass d(1);
	//error C2248: 'DisableCopyClass::DisableCopyClass' : cannot access private member declared in class 'DisableCopyClass'
	//DisableCopyClass c = d;

	CB cb = CB();
	cb.f();
	CC cc = CC();
	cc.f();
	// If CB and CC do not hava same f()
	//error C2385: ambiguous access of 'f'
	//        could be the 'f' in base 'CA'
	//       or could be the 'f' in base 'CA'
	// If CB abd CC hava same f()
	//error C2385: ambiguous access of 'f'
	//       could be the 'f' in base 'CB'
	//       or could be the 'f' in base 'CC'
	CD cd = CD();
	//cd.f();

	VB vb = VB();
	vb.f();

	VD vd = VD();
	// if VB and VC do not have same f(), below code can pass build. Or else, there are VB.f() and VC.f().
	// vd.f();
	vd.VC::f();
}